/**
 * 联系方式校验
 */

function verifyPhone() {
    let phone = document.getElementById("phone").value;
    //手机座机同时验证 ：^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$,
    //移动电话
    let mobilePhoneRegExp = new RegExp("^(?:(?:\\+|00)86)?1(?:(?:3[\\d])|(?:4[5-7|9])|(?:5[0-3|5-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\\d])|(?:9[1|8|9]))\\d{8}$");
    //固定电话
    let telephoneRegExp = new RegExp("^\\d{3}-\\d{8}$|^\\d{4}-\\d{7}$");
    if (!mobilePhoneRegExp.test(phone) && !telephoneRegExp.test(phone)) {
        alert("联系电话格式不准确");
    }
}
function verifyEmail() {
    let email = document.getElementById("email").value;
    //邮箱
    let emailRegExp = new RegExp("^^\\w+@[a-z0-9]+\\.[a-z]{2,4}$");
    if (!emailRegExp.test(email)) {
        alert("电子邮箱地址格式不准确");
    }
}